# Copyright (C) 2006  Stephane Alnet
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 

#
# For more information visit http://carrierclass.net/
#

use strict;
use warnings;

package CCNCore::Model::ProvisioningServers;

use Jifty::DBI::Schema;

use CCNCore::Record schema {

    column provisioning_system =>
        is mandatory,
        references CCNCore::Model::Provisioning,
        since '0.0.1',
        label is 'Provisioning system',
        hints is 'The provisioning system.';

    column server =>
        is mandatory,
        references CCNCore::Model::Server,
        since '0.0.1',
        label is 'Server',
        hints is 'A server part of the provisioning system. Must be a member of the same System as the Database servers used by the Provisioning system.';

    column ssh_pubkey =>
        type is 'text',
        since '0.0.1',
        label is 'The SSH public key for the server, if the server is a CDN node.',
        hints is 'If a server is identified as a distributor to the CDN servers, its key must be stored here. If no key is provided, then the server is only used for provisioning, not distribution. Note: The key is hex-encoded.';

};

use CCNCore::Mixin::Active;

sub since { 0.0.1 }
sub authorize_via { qw( provisioning_system provisioning ) }

1;
